﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>角色指派</title>

    <#include "/pages/include/head.ftl" />
	<#import "/pages/import/images.ftl" as img />
	<style>
	</style>
	<script>
	</script>
</head>
<body>
<div class="popwindow-title">角色指派</div>
<div class="popwindow-container">
      <!--列表-->
<@rw.grid 
	id="roleGrid" 
	caption="" 
	pager="true"
	gridModel="gridModel"
	rowList="10,15,20"
	rowNum="10"
	rownumbers="true"
	multiselect="true"
	width="760"
	onGridCompleteTopics="grid-complete">
	<@sj.gridColumn name="id" 			index="id"			title="序号" 		hidden="true"	sortable="false"/>
	<@sj.gridColumn name="name" 		index="name"		title="功能角色名称" 	formatter="showlink" formatoptions="{baseLinkUrl:'%{showurl}'}" />
	<@sj.gridColumn name="description" 		index="description"		title="描述" 	sortable="false"/>
</@rw.grid>
      <div id="grid"></div>
      <!--结束-->
    </div>
<div class="popwindow-btn-area">
  <div class="btn-order" onclick="doSave()">
    <ul>
      <li class="left-normal" id="btn1_11"></li>
      <li class="middle-normal" id="btn1_12" onmouseover="btn_change_over(1)" onmouseout="btn_change_out(1)" onblur="btn_change(1)"><img src="${contextPath}/images/ico16/ico-ok.gif" alt="" />确 定</li>
      <li class="right-normal" id="btn1_13"></li>
    </ul>
  </div>
  <div class="btn-order" onclick="windowClose()">
    <ul>
      <li class="left-normal" id="btn1_31"></li>
      <li class="middle-normal" id="btn1_32" onmouseover="btn_change_over(3)" onmouseout="btn_change_out(3)" onblur="btn_change(3)"><img src="${contextPath}/images/ico16/ico-cancel.gif" alt="" />取 消</li>
      <li class="right-normal" id="btn1_33"></li>
    </ul>
  </div>
</div>
<input type="hidden" id="id" name="id" value="${Request.id}"/>
<script>
   function doSave(){ 
   
      var selectedIds = $("#roleGrid").jqGrid('getGridParam','selarrrow');
      if(selectedIds.length==0){
          alert("请选择至少选择一个角色");
          return;
      }
     
     $.ajax({                                                
	      type: "POST",                                     
	      url: "paramAccount-addRoles.action",                                    
	      data: "id="+$("#id").val()+"&selectedIds="+selectedIds,   
	      success: function(msg){
    	    windowClose();  	   
	      } 
	  }); 
   }
</script>

</body>
</html>
